package com.blb.kafka_producer.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class KafkaConfig {

    public static final String TOPIC = "test-topic";

    /**
     * 新建Topic，主题名、分区数，副本数
     */
    @Bean
    public NewTopic newTopic(){
        return new NewTopic(TOPIC,1, (short) 1);
    }
}
